package com.dr.springboot.starter.controller;

import com.dr.springboot.starter.exception.RestException;
import com.dr.springboot.starter.handler.TestExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/aop")
public class AOPController {

    private String pname="private name";

    @GetMapping("/hook")
    public String getMessage(@RequestParam() String name) {
        return "test aop:" + name;
    }

    @GetMapping("/exception")
    public String throwException(){
        throw new RestException(500,"haha");
    }

    @GetMapping("/hook2")
    public String getMessage2() {
        return "test aop2";
    }
}
